<!--订单详情-->
<template>
	<div class="a">
		<van-nav-bar
		  title="评价"
		  left-arrow
		  @click-left="onClickLeft"
		  :border="false"
		>	
		  <van-icon name="arrow-left" slot="left" color="#000" size="20"/>
	    </van-nav-bar>	
		<van-field 
		  v-model="params.commentTxt"
		  rows="5"
		  autosize
		  label-width='0'
		  type="textarea"
		  placeholder="聊聊这次交易您的感受"
		  
		/>   
		<div class="b">赏个好评吧 ! </div>
		
		<div class="c">
			<div class="c1" :class="{active:active==1}" @click="changeActice(1)"> 
				<span><img src="../../../../../static/img/xiao.png" alt="" /></span>
				<span>赏好评</span>
			</div>
			<div class="c1" :class="{active:active==0}" @click="changeActice(0)">
				<span><img src="../../../../../static/img/ku.png" alt="" /></span>
				<span>不赏</span>
			</div>
		</div>
		
		
		<div class="d">
			<div class="d1">
				<van-button color="#ffda44" block class="d2" @click="publish">发表评论</van-button>
			</div>
		</div>
  
	</div>	
</template>

<script>

import {getFun,getTimer} from '@/api/publicFun.js'	 
let publicFun=getFun()		
export default {
	name: 'evaluate',	
	data() {
       return {
          active:-1,
          params:{
          	commentTxt:'',
          	goodsId:'',
          	ordersId:'',
          	userId:'',
          	commentIsgood:0
          },
          url1:this.$api+'/marketorderservice/api/v1/market/addCommnet',
          url2:'/'
       }
	},
	methods: {	
       changeActice(num){
       	 this.active=num
       	 this.params.commentIsgood=num
       },
       publish(){
       	  let that=this
	      this.$Axios.Post(this.url1,this.params)
	      .then(function(res) {
			  // that.link('/market/order/reachBuy')	                    
	      })       	
       }
	},
	mixins:[publicFun],//混入		
	mounted() {
		this.params.ordersId=this.$router.currentRoute.query.ordersId;
		this.params.userId=this.$router.currentRoute.query.userId;	
		this.params.goodsId=this.$router.currentRoute.query.comId
	}
}	
</script>

<style scoped="">
.a{background: #e5e5e5;height: 100%;width: 100%;position: absolute;}
.b{padding: 10px 0;text-align: center;font-size: 14px;}
.c{padding: 0 10px;display: flex;justify-content: space-between;}
.c1{background: #fff;width: 49%;padding: 10px 0;font-size: 14px;display: flex;justify-content: center;border:1px solid transparent}
.c1.active{border:1px solid #ffda44}
.c1 img{display: block;margin-right: 6px;}
.d{position: absolute;bottom: 0;left: 0;width: 100%;background: #fff;padding: 10px;}
.van-button__text{color: #000;font-size: 16px;}
</style>